package com.example.listener;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.EventListener;

/**
 * 不需要继承implements ApplicationListener<ApplicationEvent>，获得监听器的 ，等于PrintAllApplicationListener
 */
@Configuration
public class PrintAllApplicationListener1 {
    @EventListener(classes = {ApplicationEvent.class})
    public void listen(ApplicationEvent event) {
        System.out.println("PrintAllApplicationListener1事件触发：" + event.getClass().getName());
    }
}
